﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CodeGenerationPipeline;
using CodeGenerationPipeline.Contracts;
using System.IO;

namespace XmlSchemas
{
    public class XmlSchemasGenerator : BaseGenerator
    {
        public override event WatchProcess OnWatchProcess;

        public override string Name
        {
            get
            {
                return "Xml Services Generator";
            }
        }

        public override string Description
        {
            get
            {
                return "";
            }
        }

        public override ICodeGenerationPackage GenerateFrom(Dictionary<string, IElementBuild> builds, DirectoryInfo workspaceDirectory)
        {
            builds.Values.ToList<IElementBuild>().ForEach(e => host.GenerateFile<ClassGenerator>(e, new FileInfo(Path.Combine(workspaceDirectory.FullName, e.Element.Name) + ".cs")));

            return null;
        }

        public override ICodeGenerationPackage GenerateFromPackage(ICodeGenerationPackage incomingPackage)
        {
            throw new NotImplementedException();
        }
    }
}
